﻿using ControleRepresentante.Data.Catalogs;
using ControleRepresentante.Data.Helpers;

namespace ControleRepresentante.Data.CatalogSteps
{
    internal class CreateAttributeHolderTableCatalogStep : CatalogStepBase<ControleRepresentanteCatalogStepTypes>
    {
        protected override ControleRepresentanteCatalogStepTypes CatalogStepType
        {
            get { return ControleRepresentanteCatalogStepTypes.CreateAttributeHolderTableCatalogStep; }
        }

        public override void Execute(IDataAccess dataAccess)
        {
            new CatalogStepHelper(dataAccess)
                .CreateTable("AttributeHolder")
                    .AddColumn("RepresentanteId", ColumnType.Guid, false, false)
                    .AddForeignKey("RepresentanteId", "Representante");
        }
    }
}
